package Operation;

import Book.BookList;

public class ExitOperation implements ioperation{
    public void work(BookList bookList) {
        System.out.println("退出系统！");
        for (int i = 0; i < bookList.getUsedSize(); i++) {

            //遍历书架清空书置为null
            bookList.setBooks(null,0);

            //书架的书总数也为0
            bookList.setUsedSize(0);

            //退出系统
            System.exit(0);
        }
    }
}
